Restructuring programs by tucking statements into functions

نویسندگان

  • Arun Lakhotia
  • Jean-Christophe Deprez
چکیده

Changing the internal structure of a program without changing its behavior is called restructuring. This paper presents a transformation called tuck for restructuring programs by decomposing large functions into small functions. Tuck consists of three steps: Wedge, Split, and Fold. A wedge—a subset of statements in a slice—contains computations that are related and that may create a meaningful function. The statements in a wedge are split from the rest of the code and folded into a new function. A call to the new function is placed in the now restructured function. That tuck does not alter the behavior of the original function follows from the semantic preserving properties of a slice.

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Restructuring Functions with Low Cohesion

We present a technique for restructuring functions with low cohesion into functions with high cohesion. Such restructuring is desirable when re-architecting a legacy system into an object-oriented architecture. The restructured system has functions with higher cohesion and hence lower coupling. This enables finer-grained grouping of functions into objects. Automatically decomposing a function i...

متن کامل

3D Origami Design based on Tucking Molecule

This paper presents a new approach for folding a piece of paper into an arbitrary three-dimensional polyhedral surface based on ”tucking molecules.” The approach is to align the polygons of the three-dimensional surface onto a convex region of a plane and fill the blank area between the polygons with ”tucking molecules.” Tucking molecules are aligned between segments and vertices of the polygon...

متن کامل

Proving program refinements and transformations

In this thesis we develop a theory of program refinement and equivalence which can be used to develop practical tools for program development, analysis and modification. The theory is based on the use of general specifications and an imperative kernel language. We use weakest preconditions, expressed as formulae in infinitary logic to prove refinement and equivalence between programs. The kerne...

متن کامل

A similarity criterion for sequential programs using truth-preserving partial functions

The execution of sequential programs allows them to be represented using mathematical functions formed by the composition of statements following one after the other. Each such statement is in itself a partial function, which allows only inputs satisfying a particular Boolean condition to carry forward the execution and hence, the composition of such functions (as a result of sequential executi...

متن کامل

Non-Deterministic Expressions and Predicate Transformers

Non-determinacy is important in the formal specification and formal derivation of programs, but non-determinacy within expressions is theoretically problematical. The refinement calculus side-steps the problem by admitting non-determinacy only at the level of statements, leading to a style of programming that favours statements and procedures over expressions and functions. But expressions are ...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

عنوان ژورنال:
  • Information & Software Technology

دوره 40  شماره 

صفحات  -

تاریخ انتشار 1998